package fun.coding.array;

import java.io.InputStream;
import java.util.ArrayList;

import org.apache.commons.lang3.tuple.Pair;

import fun.coding.array.ArrayManipulationImpl.MethodType;

public interface ArrayManipulation {
    void removeDuplicateAndCondenseArray(int[] array, int k);
    
    void removeDuplicateAndCondenseArrayBetter(int[] array, int k);
    
    int maxSameSubSequence(int[] array);
    
    void printMaxSlidingWindow(int[] array, int k);
    
    int largestKthElementHeapSolution(int[] array, int k);
    
    ArrayList<ArrayList<Integer>> threeSum(int[] num);
    
    ArrayList<Integer> mergeTwoSortedArrays(int[] a, int[] b);
    
    int reverse(int x);
    
    int findNumOnlyAppearOnceInPairArray(int[] array);
    
    int findMedian(int[] array);
    
    int findMedianStream(InputStream is);
    
    int find3Median(int a, int b, int c);
    
    ArrayList<Integer> mergeNSortedArray(ArrayList<ArrayList<Integer>> al);
    
    public int findKthSmallestInTwoSortedArray(int[] a1, int[] a2, int k);
    
    public ArrayList<Integer> intersectTwoSortedArrays(int[] a1, int[] a2);
    
    public ArrayList<ArrayList<Integer>> twoSum(int[] a, int sum, MethodType t);
    
    public ArrayList<Integer> findKNearestNumber(int[] a, int k, int num);
    
    public int[] reservoirSampling(int size, int k);
    
    public void printIntervalsArray(int[] array);
    
    public int[] copyArray(int[] a, int dx, int dy, int sx, int sy, int w, int h, int aWidth, int aHeight);
    
    public void printSpiralMatrix(int[][] array);
    
    public Pair<Integer, Integer> divideWithoutSubtraction(int m, int n);
    
    public Pair<Integer, Integer> divideWithSubtraction(int m, int n); 
    
    public int largestRectangleArea(int[] height);
    
    public int largestRectangleAreaONSquare(int[] height);
    
    public void rotateArrays(int[] array, int k);
    
    public void rotateArraysBetter(int[] array, int k);
    
    public ArrayList<Integer> findLongestIncreasingSeq(int[] array);
    
    public ArrayList<Integer> findContinuousSum(int n);
    
    public int calculateSumWithoutAdd(int n);
    public ArrayList<Integer> findPrimes(int n);
}
